﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FrameDetectionTest.Interface
{
    public partial class Config : Form
    {
        Settings _settings;
        public Config(Settings settings)
        {
            InitializeComponent();
            _settings = settings;
            propertyGrid1.SelectedObject = _settings;
        }

        private void Config_FormClosed(object sender, FormClosedEventArgs e)
        {
            Common.SaveConfig(_settings);
            DialogResult = DialogResult.OK;
        }

        private void Config_Shown(object sender, EventArgs e)
        {
            if (!System.IO.Directory.Exists(_settings.ProjectPath))
            {
                System.IO.Directory.CreateDirectory(_settings.ProjectPath);
            }
        }
    }
}
